package com.dgut.thread;

/**
 * 如果是sleep  wake  join会清空打断标记
 */
public class JoinTest {
        static int r = 0;
        public static void main(String[] args) throws InterruptedException {
            test1();
        }
        private static void test1() throws InterruptedException {
            Thread t1 = new Thread(() -> {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                r = 10;
            });
            Thread.sleep(500);
            t1.start();
            t1.join();
            System.out.println(r);
        }
}
